package com.ruoyi.file.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件分片对象 file_chunk_info
 * 
 * @author rww
 * @date 2023-02-20
 */
public class FileChunkInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 文件ID */
    private Long id;

    /** 当前文件块，从1开始 */
    @Excel(name = "当前文件块，从1开始")
    private Long chunkNumber;

    /** 每块大小 */
    @Excel(name = "每块大小")
    private Long chunkSize;

    /** 当前分块大小 */
    @Excel(name = "当前分块大小")
    private Long currentChunkSize;

    /** 文件标识 */
    @Excel(name = "文件标识")
    private String identifier;

    /** 文件名 */
    @Excel(name = "文件名")
    private String filename;//前端的那个组件参数名称是：filename

    /** 相对路径 */
    @Excel(name = "相对路径")
    private String relativePath;

    /** 总块数 */
    @Excel(name = "总块数")
    private Integer totalChunks;

    /** 文件类型 */
    @Excel(name = "文件类型")
    private String fileExt;

    /** 总大小 */
    @Excel(name = "总大小")
    private Long totalSize;

    /**
     * 块内容
     */
    private transient MultipartFile upfile;


    public MultipartFile getUpfile() {
        return upfile;
    }

    public void setUpfile(MultipartFile upfile) {
        this.upfile = upfile;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setChunkNumber(Long chunkNumber) 
    {
        this.chunkNumber = chunkNumber;
    }

    public Long getChunkNumber() 
    {
        return chunkNumber;
    }
    public void setChunkSize(Long chunkSize) 
    {
        this.chunkSize = chunkSize;
    }

    public Long getChunkSize() 
    {
        return chunkSize;
    }


    public Long getCurrentChunkSize() {
        return currentChunkSize;
    }

    public void setCurrentChunkSize(Long currentChunkSize) {
        this.currentChunkSize = currentChunkSize;
    }

    public void setIdentifier(String identifier)
    {
        this.identifier = identifier;
    }

    public String getIdentifier() 
    {
        return identifier;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public void setRelativePath(String relativePath)
    {
        this.relativePath = relativePath;
    }

    public String getRelativePath() 
    {
        return relativePath;
    }
    public void setTotalChunks(Integer totalChunks) 
    {
        this.totalChunks = totalChunks;
    }

    public Integer getTotalChunks() 
    {
        return totalChunks;
    }
    public void setFileExt(String fileExt) 
    {
        this.fileExt = fileExt;
    }

    public String getFileExt() 
    {
        return fileExt;
    }
    public void setTotalSize(Long totalSize) 
    {
        this.totalSize = totalSize;
    }

    public Long getTotalSize() 
    {
        return totalSize;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("chunkNumber", getChunkNumber())
            .append("chunkSize", getChunkSize())
            .append("currentChunkSize", getCurrentChunkSize())
            .append("identifier", getIdentifier())
            .append("filename", getFilename())
            .append("relativePath", getRelativePath())
            .append("totalChunks", getTotalChunks())
            .append("fileExt", getFileExt())
            .append("totalSize", getTotalSize())
            .toString();
    }
}
